<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<p>예매하실 날짜를 선택해주세요.</p>
<div id="playdate"></div>
<input type="hidden" id="hiddendate" />
<c:forEach var="d" items="${date}">
	<input type="hidden" class="h_pdate" value="${d.shdate}" />
	<input type="hidden" class="h_movno" value="${d.movno}" />
	<input type="hidden" class="h_zipseq" value="${d.zipseq}" />	
</c:forEach>
<script>
var array = new Array();
var str = "";
for (var i = 0; i<$(".h_pdate").length; ++i){
	array.push($(".h_pdate").eq(i).val());
}
	$("#playdate").datepicker({
		dateFormat: 'yy-mm-dd',
  	    monthNames: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
  	    monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
  	    dayNames: ['일','월','화','수','목','금','토'],
  	    dayNamesShort: ['일','월','화','수','목','금','토'],
  	    dayNamesMin: ['일','월','화','수','목','금','토'],
  	    showMonthAfterYear: true,
  	    yearSuffix: '년',
		altField: "#hiddendate",
		altFormat: "yy-mm-dd",
		beforeShowDay: function(date){
	        var string = jQuery.datepicker.formatDate('yy-mm-dd', date);	        
	        var	result = array.indexOf(string) != -1;	       
	        return [ result ];
	    },
		onSelect: function(){
						gettime($(".h_movno").eq(0).val(),
								$(".h_zipseq").eq(0).val(),
								$("#hiddendate").val());
						}
				
	});
</script>